import { createRouter, createWebHistory } from 'vue-router'
import layout from '@/layout/index.vue'
import home from '@/views/home/index.vue';
import loginRegister from '@/views/loginRegister/index.vue';
import classPage from '@/views/classPage/index.vue'
import submit from '@/views/submit/index.vue'

const routes = [
  {
    path: '/',
    name: 'productCenter',
    component: layout,
    meta: {

    },
    children: [
      {
        path: '/home',
        name: 'home',
        meta: {
          title: "首页"
        },
        component: home
      },
      {
        path: '/loginRegister',
        name: 'loginRegister',
        meta: {
          title: "登录或注册"
        },
        component: loginRegister
      },
      {
        path: '/classPage',
        name: 'classPage',
        meta: {
          title: "分类"
        },
        component: classPage
      },
      {
        path: '/submit',
        name: 'submit',
        meta: {
          title: "提交"
        },
        component: submit
      },
    ]
  }
]

const router = createRouter({
  history: createWebHistory('/'),
  routes
});

export default router
